<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>日志管理</title>
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/css.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/page.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/css.css" />
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery-1.7.2.min.js"></script>
<link href="${pageContext.request.contextPath}/css/style2.css"
	rel="stylesheet" type="text/css" />
</head>

<body>

	<table width="100%" border="0" cellspacing="0" cellpadding="0">

		<tr>
			<td height="30">
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td height="62"
							background="${pageContext.request.contextPath}/images/nav04.png">

							<table width="98%" border="0" align="center" cellpadding="0"
								cellspacing="0">
								<tr>
									<td width="20"><img
										src="${pageContext.request.contextPath}/images/ico07.gif"
										width="20" height="18" /></td>
									<td width="519">
										<form
											action="${pageContext.request.contextPath}/log/queryLogByCon"
											method="post" autocomplete="off" onSubmit="return chkads()"
											id="l">
											编号：<input type="text" name="id" value="${listid}" size="12" />
											姓名：<input type="text" name="userName" value="${listname}"
												size="12" /> <input type="submit" value="查询"
												onclick="tableHi()" class="right-button02" />
									</td>
									</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									</td>
									</form>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>

		<tr id="all">
			<td><table id="subtree1" style="DISPLAY:" width="100%"
					border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td><table width="95%" border="0" align="center"
								cellpadding="0" cellspacing="0">
								<tr>
									<td height="40" class="font42">
										<table width="100%" border="0" cellpadding="4" cellspacing="1"
											bgcolor="#464646" class="newfont03">

											<tr>
												<td height="20" colspan="15" align="center"
													bgcolor="#EEEEEE" class="tablestyle_title">
													&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
													&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
													&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
													&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
													&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
													&nbsp;&nbsp;&nbsp;&nbsp;日志详细列表&nbsp;</td>
											</tr>
											<tr>
												<td width="6%" align="center" height="42" bgcolor="#EEEEEE">日志编号</td>
												<td width="6%" height="20" align="center" bgcolor="#EEEEEE">ip</td>
												<td width="10%" align="center" bgcolor="#EEEEEE">路径</td>
												<td width="9%" align="center" bgcolor="#EEEEEE">时间</td>
												<td width="5%" align="center" bgcolor="#EEEEEE">姓名</td>
												<td width="5%" align="center" bgcolor="#EEEEEE">操作</td>
											</tr>
											<c:forEach items="${list}" var="item" varStatus="my">
												<tr>


													<td align="center" height="42" bgcolor="#FFFFFF">${item.id}</td>
													<td align="center" bgcolor="#FFFFFF">${item.ip}</td>

													<td align="center" bgcolor="#FFFFFF">${item.path}</td>
													<td align="center" bgcolor="#FFFFFF"><fmt:formatDate
															value="${item.date}" pattern="yyyy-MM-dd HH:mm:ss"
															type="both" /></td>
													<td align="center" bgcolor="#FFFFFF">${item.userName}</td>
													<td align="center" bgcolor="#FFFFFF"><a
														href="${pageContext.request.contextPath}/log/deleteLog?id=${item.id}"
														onclick="return formSub1()">删除</a></td>
												</tr>
											</c:forEach>

										</table>
									</td>
								</tr>
							</table></td>
					</tr>
				</table></td>
		</tr>

	<%-- 	<tr id="byCon">
			<td><table id="subtree1" style="DISPLAY:" width="100%"
					border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td><table width="95%" border="0" align="center"
								cellpadding="0" cellspacing="0">
								<tr>
									<td height="40" class="font42">
										<table width="100%" border="0" cellpadding="4" cellspacing="1"
											bgcolor="#464646" class="newfont03">

											<tr>
												<td height="20" colspan="15" align="center"
													bgcolor="#EEEEEE" class="tablestyle_title">
													&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
													&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
													&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
													&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
													&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
													&nbsp;&nbsp;&nbsp;&nbsp;日志详细列表&nbsp;</td>
											</tr>
											<tr>
												<td width="6%" align="center" bgcolor="#EEEEEE">日志编号</td>
												<td width="6%" height="20" align="center" bgcolor="#EEEEEE">ip</td>
												<td width="10%" align="center" bgcolor="#EEEEEE">路径</td>
												<td width="9%" align="center" bgcolor="#EEEEEE">时间</td>
												<td width="5%" align="center" bgcolor="#EEEEEE">姓名</td>
												<td width="15%" align="center" bgcolor="#EEEEEE">操作</td>
											</tr>
											<c:forEach items="${byCon}" var="item" varStatus="my">
												<tr>

													<td align="center" bgcolor="#FFFFFF">${item.id}</td>
													<td align="center" bgcolor="#FFFFFF">${item.ip}</td>

													<td align="center" bgcolor="#FFFFFF">${item.path}</td>
													<td align="center" bgcolor="#FFFFFF"><fmt:formatDate
															value="${item.date}" pattern="yyyy-MM-dd HH:mm:ss"
															type="both" /></td>
													<td align="center" bgcolor="#FFFFFF">${item.userName}</td>
													<td align="center" bgcolor="#FFFFFF"><a
														href="${pageContext.request.contextPath}/log/deleteLog?id=${item.id}"
														onclick="return formSub1()">删除</a></td>
												</tr>
											</c:forEach>

										</table>
										
										
										
									</td>
								</tr>
							</table></td>
					</tr>
				</table></td>
		</tr> --%>
		
		<tr><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="6"><img src="${pageContext.request.contextPath}/images/spacer.png" width="1" height="1" /></td>
        </tr>
        <tr>
          <td height="33"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="right-font08">
              <tr>
                <td width="50%">共 <span class="right-text09">${page.totalPageCount }</span> 页 | 第 <span class="right-text09">${page.pageNow}</span> 页</td>
                <td width="45%" align="right">
                [ <a href="#" class="right-font08" onclick="firstPage();">首页</a>
                | <a href="#" class="right-font08" onclick="previousPage();">上一页</a>
                | <a href="#" class="right-font08" onclick="nextPage();">下一页</a> 
                | <a href="#" class="right-font08" onclick="lastPage();">末页</a>
                ] </td>
              
              </tr>
          </table>
          </td>
        </tr>
      </table></tr>
</table>



		<script type="text/javascript">
			$(document).ready(function() {
				$("#byCon").hide();
			})

			function tableHi() {
				$("#all").hide();
				$("#byCon").show();
			}

			/*删除的弹框  */
			function formSub1() {
				var msg = "您真的确定要删除吗？";
				if (confirm(msg) == true) {
				} else {
					alert("删除失败");
					return false;
				}
			}

			
			//当前第几页数据
			var currentPage = ${page.pageNow};
			//总页数
			var totalPage = ${page.totalPageCount};
			//第一页
			function firstPage() {
				if (currentPage == 1) {
					alert("已经是第一页数据");
					return false;
				} else {
					window.location.href = "${pageContext.request.contextPath }/log/queryLogByCon?id=${listid}&userName=${listname}&pageNow=1";
					return true;
				}
			}
			//下一页
			function nextPage() {
				if (currentPage == totalPage) {
					alert("已经是最后一页数据");
					return false;
				} else {
					
					window.location.href = "${pageContext.request.contextPath }/log/queryLogByCon?id=${listid}&userName=${listname}&pageNow="+ (currentPage + 1);
					return true;
				}
			}
			//上一页
			function previousPage() {
				if (currentPage == 1) {
					alert("已经是第一页数据");
					return false;
				} else {
					window.location.href = "${pageContext.request.contextPath }/log/queryLogByCon?id=${listid}&userName=${listname}&pageNow="+ (currentPage - 1);
					return true;
				}
			}
			//尾页
			function lastPage() {
				if (currentPage == totalPage) {
					alert("已经是最后一页数据");
					return false;
				} else {

					window.location.href = "${pageContext.request.contextPath }/log/queryLogByCon?id=${listid}&userName=${listname}&pageNow="+ (totalPage);
					return true;
				}
			}
		
			
			
		</script>
</body>
</html>